﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Enterprise.Management.Common;

namespace Enterprise.Management.Business
{
    public class BaseBLL
    {
        private DeptPortalsDataContext context;
        protected DeptPortalsDataContext DataContext
        {
            get
            {
                if (context == null)
                {
                    context = new DeptPortalsDataContext();
                }
                return context;
            }
        }

        public bool Submit()
        {
            if (context != null)
            {
                try
                {
                    context.SubmitChanges();
                    return true;
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                }
            }

            return false;
        }
    }
}